home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
weyl
/
weyl!!.lha
/
simple2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-21
|
2KB
|
70 lines
#include <stdlib.h>
#include <stream.h>
class DomainElt {
private:
int RepType ;
const void *domain;
const void *Value;
public:
virtual void printon(ostream& out) {out << "[Domain Elt]";};
};
class Integer : public virtual DomainElt {
public:
void otheron(ostream& out) {out << "Other [Integer]"; };
void otheron2(ostream& out) {out << "Other2 [Integer]"; };
};
class Integer2 : public virtual DomainElt {
public:
virtual void otheron(ostream& out) {out << "Other [Integer]"; };
void otheron2(ostream& out) {out << "Other2 [Integer]"; };
void otheron3(ostream& out) {out << "Other3 [Integer]"; };
void otheron4(ostream& out) {out << "Other4 [Integer]"; };
void otheron5(ostream& out) {out << "Other5 [Integer]"; };
void otheron6(ostream& out) {out << "Other6 [Integer]"; };
};
class Integer3 : public virtual Integer {
public:
void otheron(ostream& out) {out << "Other [Integer3]"; };
void otheron2(ostream& out) {out << "Other2 [Integer]"; };
};
class Integer4 : public virtual Integer {
public:
virtual void otheron(ostream& out) {out << "Other [Integer3]"; };
void otheron2(ostream& out) {out << "Other2 [Integer]"; };
};
class Vector: public virtual DomainElt {
public:
Vector *VectorRep() { return this; };
};
main () {
DomainElt a;
Integer b;
Integer2 c;
Integer3 d;
Integer4 e;
Vector f;
cout << "Domain Element size = " << sizeof(a) << "\n";
cout << "Integer Element size = " << sizeof(b) << "\n";
cout << "Integer2 Element size = " << sizeof(c) << "\n";
cout << "Integer3 Element size = " << sizeof(d) << "\n";
cout << "Integer4 Element size = " << sizeof(e) << "\n";
cout << "Vector Element size = " << sizeof(f) << "\n";
return(0);
};